/**
 * 
 */
package com.gwcloud.leetcode.hot100;

import com.gwcloud.leetcode.common.datastructure.TreeNode;

/**
 * @ClassName   : Leetcode617 
 * @author      : ganwei 
 * @date        : 2020年5月3日
 * @Description : Leetcode617 合并二叉树
 */
public class Leetcode0617 {
    /**
     * 递归处理
     */
	public TreeNode mergeTrees(TreeNode t1, TreeNode t2) {
		if(t1 == null){
			return t2;
		}
		if(t2 == null){
			return t1;
		}
		t1.val += t2.val;
		t1.left = mergeTrees(t1.left, t2.left);
		t1.right = mergeTrees(t1.right, t2.right);
    	return t1;
    }
    
    
    public static void main(String[] args){
    	
    }
}
